<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        *{
            margin: 0;
            padding: 0;
        }
        .red{
            border: 1px solid red;
        }
        .gray{
            border: 1px solid gray;
        }
        .blue{
            border: 1px solid blue;
        }
        .box{
            width: 300px;
            height: 30px;
        }
        p{
            /* 文字不换行 */
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
        .tags{
            float: right;
            height: 30px;
        }

        .tag{
            float: left;
            height: 20px;
            padding: 0 4px;
            line-height: 20px;
            margin: 0 4px;

        }
    </style>
</head>
<body>
    <div class="box">
        
        <div class="tags">
            <div class="tag red">秀洲</div>
            <div class="tag gray">哈哈哈</div>
            <div class="tag blue">呵</div>
            
        </div>
        <p>这是一个长度不固定的盒子</p>

    </div>
</body>
</html>